home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MATHS
/
RLAB
/
RLAB125.ZIP
/
!RLaB
/
rlib
/
num2str
< prev
next >
Wrap
Text File
|
1994-05-08
|
681b
|
33 lines
//-------------------------------------------------------------------//
// Synopsis: Convert a number object into a string-object.
// Syntax: num2str ( N )
// Description:
// Num2str converts the real-numeric argument into a string, which
// is the return value.
//-------------------------------------------------------------------//
num2str = function ( N )
{
local (i, j, s, stmp)
if (class (N) == "num" && type (N) == "real")
{
s = [];
for (i in 1:N.nr)
{
for (j in 1:N.nc)
{
sprintf (stmp, "%.4g", N[i;j]);
s[i;j] = stmp;
}
}
return s;
else
error ("num2str: argument must be numeric-real");
}
};